﻿using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class student_bookInfo2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["title"] != null)
        {
            string title=p1.InnerText = Request.QueryString["title"].ToString();
            MySqlConnection con = DbUtils.getCon();
            MySqlCommand cmd = new MySqlCommand("select * from course where cname='"+title+"'", con);
            MySqlDataReader dr = cmd.ExecuteReader();
            if (dr.Read())
            {

                img_book.Src = dr["img"].ToString();
                string[] author_publisher = dr["author"].ToString().Split(';');
                string author = author_publisher[0] + "著<br/><br/>";
                string publisher = author_publisher[1];
                p_author.InnerHtml = author + publisher;
                p_introduce.InnerHtml = dr["introduce"].ToString();
            }
        }
        else
        {
            Response.Write("没有指定书籍");
        }
    }
}